Moved from gitorious
[LED tetris] / make
1 #!/bin/bash
2
3 rm -f compiled.hex compiled.lss compiled.eep compiled.elf compiled.map *.d *.o
4
5 # -DBOARD=1
6 export DEFINES="-mmcu=atmega168 -D F_CPU=4000000UL"
7
8 avr-gcc $DEFINES -Wall -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums tetris.o  -c tetris.c
9 avr-gcc $DEFINES -Wl,-Map=compiled.map tetris.o -o compiled.elf
10
11 avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature  compiled.elf compiled.hex
12 avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O ihex compiled.elf compiled.eep
13 avr-objdump -h -S compiled.elf > compiled.lss
14 avr-objdump -h -d compiled.elf > compiled.lst
15 rm -f *.o
16
17 exit
Contact me: dev (at) shalnoff (dot) com
PGP fingerprint: A6B8 3B23 6013 F18A 0C71 198B 83D8 C64D 917A 5717